﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Component
{
    [Serializable]
    public class Coordinate
    {
        private Axis xAxis;
        private double leftRate = 0.05;
        private double widthRate = 0.8;
        private double secondYRate = 0.85;
        private double thirdYRate = 0.92;

        private double bottonRate = 0.9;
        private double heightRate = 0.8;

        private Font defaultFont = new Font("Verdana", 8);

        

        /// <summary>
        /// 坐标轴上的辅助文字格式
        /// </summary>
        private SolidBrush axisDescritionBrush = new SolidBrush(Color.Black);

        /// <summary>
        /// 坐标轴上的辅助点的文字
        /// </summary>
        private SolidBrush auxiliaryBrush = new SolidBrush(Color.Black);

        private Pen axisPen;
        private Pen auxiliaryAxisPen;
        private Pen linePen;
        private SolidBrush auxiliaryAxisPointBrush;
    

        private Axis yAxis;
        private String name;


        const int aXParam = 1;
        const int aYParam = -1;
        List<Point> points = new List<Point>();
        List<Curve> curves = new List<Curve>();
        List<Line> lines = new List<Line>();
        List<CrossRegion> crossRegion = new List<CrossRegion>();
        List<RectangleX> rectangles = new List<RectangleX>();




        Brush pointBrush;
        Pen curvePen;
        Pen rectanglesPen;




        public Coordinate()
        {
            
            Brush curveBrush = pointBrush = new SolidBrush(Color.Black);
            curvePen = new Pen(curveBrush, 2);
            SolidBrush axisBrush = new SolidBrush(Color.Black);
            AxisPen = new Pen(axisBrush);


            AuxiliaryAxisPen = new Pen(Color.Gray, 1);
            AuxiliaryAxisPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;

            AxisDescritionBrush = AuxiliaryBrush = new SolidBrush(Color.White);
            RectanglesPen = new Pen(Color.Gray, 1);

        }



        public Axis XAxis { get => xAxis; set => xAxis = value; }
        public Axis YAxis { get => yAxis; set => yAxis= value; }
        public string Name { get => name; set => name = value; }
        public List<Point> Points { get => points; set => points = value; }
        public List<Curve> Curves { get => curves; set => curves = value; }
        public List<Line>  Lines { get => lines; set => lines = value; }

        public Brush PointBrush { get => pointBrush; set => pointBrush = value; }
        public Pen CurvePen { get => curvePen; set => curvePen = value; }

        public Font DefaultFont { get => defaultFont; set => defaultFont = value; }
        //public SolidBrush TextBrush { get => textBrush; set => textBrush = value; }
        public Pen AxisPen { get => axisPen; set => axisPen = value; }
        public Pen AuxiliaryAxisPen { get => auxiliaryAxisPen; set => auxiliaryAxisPen = value; }

        public double LeftRate { get => leftRate; set => leftRate = value; }
        public double WidthRate { get => widthRate; set => widthRate = value; }
        public double SecondYRate { get => secondYRate; set => secondYRate = value; }
        public double ThirdYRate { get => thirdYRate; set => thirdYRate = value; }
        public double BottonRate { get => bottonRate; set => bottonRate = value; }
        public double HeightRate { get => heightRate; set => heightRate = value; }
        public SolidBrush AuxiliaryAxisPointBrush { get => auxiliaryAxisPointBrush; set => auxiliaryAxisPointBrush = value; }
        public List<RectangleX> Rectangles { get => rectangles; set => rectangles = value; }
        public Pen RectanglesPen { get => rectanglesPen; set => rectanglesPen = value; }
        public SolidBrush AxisDescritionBrush { get => axisDescritionBrush; set => axisDescritionBrush = value; }
        public SolidBrush AuxiliaryBrush { get => auxiliaryBrush; set => auxiliaryBrush = value; }
        public Pen LinePen { get => linePen; set => linePen = value; }
        public List<CrossRegion> CrossRegion { get => crossRegion; set => crossRegion = value; }
    }
}
